TARGETS = lock_counter atomic_counter cas_counter normal_counter cas_stack
all: $(TARGETS)

CPP = g++
CPPFLAGS = -std=c++11 -g
LIBS = -lpthread

%.o : %.cpp
	$(CPP) $(CPPFLAGS) -c $< -o $@

lock_counter: lock_counter.o
	$(CPP) $^ -o lock_counter $(LIBS)

atomic_counter: atomic_counter.o
	$(CPP) $^ -o atomic_counter $(LIBS)

cas_counter: cas_counter.o
	$(CPP) $^ -o cas_counter $(LIBS)

normal_counter: normal_counter.o
	$(CPP) $^ -o normal_counter $(LIBS)

cas_stack: cas_stack.o
	$(CPP) $^ -o cas_stack $(LIBS)

.PHONY: clean
clean:
	rm -rf *.o $(TARGETS) 